package cn.ad.enumration;

public enum FeeType {

    CPM(1, "CPM"),
    CPC(0, "CPC");

    private int value;
    private String description;
    private static java.util.HashMap<Integer, String> mappings;

    private FeeType(int value, String description) {
        this.value = value;
        this.description = description;
    }

    private synchronized static java.util.HashMap<Integer, String> getMappings() {
        if (mappings == null) {
        	mappings = new java.util.HashMap<Integer, String>();
        	for (FeeType status : FeeType.values()) {
        		mappings.put(status.value, status.description);
        	}
        }
        return mappings;
    }

    public int getValue() {
        return this.value;
    }

    public String getDescription() {
        return this.description;
    }

    public static String forValue(int value) {
        return getMappings().get(value);
    }

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return this.value+"";
	}
    
    
}
